import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/ocm-product/spu/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const getPage = (current, size, params) => {
  return request({
    url: '/api/ocm-product/spu/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const getSpuPage = (current, size, params) => {
  return request({
    url: '/api/ocm-product/spu/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/ocm-product/spu/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/ocm-product/spu/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const audit = (id,auditRemark,status) => {
  return request({
    url: '/api/ocm-product/spu/audit',
    method: 'post',
    data: {
      id,auditRemark,status
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/ocm-product/spu/save',
    method: 'post',
    data: row
  })
}

export const putaway = (spuId) => {
  return request({
    url: '/api/ocm-product/spu/putaway',
    method: 'post',
    params: {
      spuId
    }
  })
}
export const soldOut = (spuId) => {
  return request({
    url: '/api/ocm-product/spu/soldOut',
    method: 'post',
    params: {
      spuId
    }
  })
}
export const update = (row) => {
  return request({
    url: '/api/ocm-product/spu/update',
    method: 'post',
    data: row
  })
}
export const status = (row) => {
  return request({
    url: '/api/ocm-product/spu/status',
    method: 'post',
    data: row
  })
}

